package com.ndp.fb.rdb.api;

import com.ndp.fb.rdb.model.*;

import java.util.List;

/**
 * Created by Evan on 2016/4/14.
 */
public interface FeedRdbService {
    Long saveFeed(FeedWe param);
    Long updateFeed(FeedWe param);
    Long saveFbFeed(FeedFb feedFb);


    FeedWe findFeedWeById(Long id);

    List<FeedWe> findAll();

    Pager<FeedWe> getFeedWithPager(Long orgId, Integer firstResult, Integer sizeNo);

    List<FeedWe> searchByIds(Long[] ids);

    /**
     * 通过 we feed id 找到fb pixel
     */
    PixelId getFbPixel(Long weFeedId);

    /**
     * 根据we feed id获取20个fb feed
     */
    FeedFb getFeedFbByFeedWeId(Long weFeedId);


    void updateUpdateDay(Long feedId,String day);

    /**
     * 更新xml校验错误信息
     */
    void updateXmlCheck(Long weFeedId, String xmlCheckErrors);

    /**
     * 更新merge后的url到 we feed
     */
    void updateMergeUrlAndStatus(Long weFeedId, String url, String status);
    void updateUrl(Long weFeedId, String url);

    /**
     * 更新操作状态
     */
    void updateStatus(Long weFeedId, String status);
    void updateStatusAndTime(Long weFeedId, String status, Long time);

    /**
     * 更新产品数量
     */
    void updateProductCount(Long weFeedId, Integer count);

    List<FeedWe> findFeedWeByProdId(Long prodId);

    /**
     * 查找重名
     */
    FeedWe findByFeedName(Long orgId, String feedName);

    /**
     *
     * @param orgId
     * @return
     */
    List<FeedWe> queryFeedWeList(Long orgId);

    /**
     * 更新fbfeedId  现在catalog对fbfeed  是1对1
     */
    void updateFbFeedId(Long fbFeedId, String feedUrl, Long productCatalogId);

    List<FeedFb> findFbFeedByMaterielId(Long materielId);
}
